package demo_code;
//类违反了单一职责原则
class VehicleRun {
    public void run(String vehicle) {
        System.out.println(vehicle + " 在公路上运行....");
    }
}
public class Vehicle {
    public static void main(String[] args) {
        VehicleRun vehicle = new VehicleRun();
        vehicle.run("摩托车");
        vehicle.run("汽车");
        vehicle.run("飞机");
        vehicle.run("轮船");
    }
}